package com.longyiqun.apitest;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Controller;

import java.util.List;
@Controller
@Mapper
public interface testmapper {
    @Select("select * from test_api_entity where sceneID =#{sceneID} order by runOrder ASC")
    List<TestApiEntity> findCaseApi(@Param("sceneID") String sceneID);

    @Select("select * from test_token_entity where loginName = #{loginName} and env = #{env} order by tokenID desc limit 1")
    TestTokenEntity findTokenUid(TestTokenEntity testTokenEntity);

    @Insert("insert into test_token_entity (loginName,token,uid,env) VALUES (#{loginName},#{token},#{uid},#{env})")
    int setTokenUid(TestTokenEntity loginEntity);
}
